<?php
//焦点图
//@author yuanjiang 932625974#qq.com
//@date 10.9.2016
if(!defined('IN_T')){
   die('hacking attempt');
}

$act = Common::sfilter($_REQUEST['act']);

//详情: 查看或编辑或增加
if($act=='site_code'){
   // $data['123'] = 1231234;
   // echo $Json->encode($data);
   $data['error'] = 1;
   if(isset($_FILES)){
      $cwd = getcwd();
      chdir(ROOT_PATH);
      if(!is_writable('static/images/code.png')){
         $data['message'] = '文件不可写，替换失败！';
      }
      else{
         if(move_uploaded_file($_FILES['imgFile']['tmp_name'],'static/images/code.png')){
            $data = array('error'=>0);
         }
      }
      chdir($cwd);
   }
   echo $Json->encode($data);
   exit;
}

$tp->assign('nav','二维码');
?>